package com.mobsandgeeks.adapters.samples;

import java.util.ArrayList;
import java.util.List;

/**
 * 数据
 *
 * @since 2021-07-01
 */
public class BooksDao {
    private static ArrayList<Book> books;
    private static final String SF = "Science Fiction";
    private static final String CAI = "Computers and Internet";

    /**
     * 私有构造
     */
    private BooksDao() {
    }

    /**
     * Initializing sample data
     */
    static {
        books = new ArrayList<Book>();
        books.add(new Book("War of the worlds", "H.G. Wells", SF));
        books.add(new Book("Hackers and Painters", "Paul Graham",
                CAI));
        books.add(new Book("Wool", "Hugh Howey", SF));
        books.add(new Book("The Time Machine", "H.G. Wells", SF));
        books.add(new Book("Zero Day", "Mark Russinovich",
                CAI));
        books.add(new Book("The Sign of Four", "Sir Arthur Conan Doyle",
                "Thriller"));
        books.add(new Book("Hackers:Heros of Computer Revolution",
                "Steven Levy", CAI));
        books.add(new Book("Thinking, Fast and Slow", "Daniel Kahneman",
                "Nonfiction"));
        books.add(new Book("Linear Algebra and its Applications",
                "Paul Strang", "Math"));
    }

    public static List<Book> getAllBooks() {
        return books;
    }
}
